1. Field of the Invention
The invention relates to JavaScript application profiling. More specifically, the invention relates to injecting logging statements into Web 2.0 JavaScript applications to trace a target JavaScript object.
2. Description of the Related Art
One of the problems in the Web 2.0 world is serviceability of client code and the unknown factor “browser”. Developers do not know which browser will be used and which features that browser might support currently or in a future release. Web 2.0 applications written in JavaScript provide only very basic features for logging in support of tracing and debugging, mainly by changing the source code during development time. The requirement for logging to fix runtime problems is not only important in support of development and quality assurance but also in support of problem determination after an application has been deployed. More and more applications rely heavily on the use of JavaScript, not only for traditional browser applications, but also applications running on portable devices such as the iPhone™.
Today no solution exists that allows a developer to trace JavaScript code execution on the client side without installing additional client software, re-writing the JavaScript using a proxy, or convoluting the source code with explicit logging statements.
The present invention solves the problem by allowing a developer to get information about which functions have been called, what parameters have been passed and the timing information of the function calls through dynamic injection of logging code without the need to install client side software, re-writing the JavaScript using a proxy, or adding explicit logging statements. Furthermore exceptions are caught and can be reported either back to the server to be sent to a repository so that the developers can review the stack dump for further analysis or the information can be displayed in a client widget, etc.